﻿using System.Windows;
using System.Windows.Input;

namespace Sonce.Editor.Tools
{
    public class ZoomTool : IEditorTool
    {
        #region Constructor
        public ZoomTool()
        {
        }
        #endregion

        #region IEditorTool Members
        public Editor Editor
        {
            get;
            set;
        }

        public bool KeyDown(Key key)
        {
            return false;
        }

        public bool KeyUp(Key key)
        {
            return false;
        }

        public bool MouseDown(Point position)
        {
            return false;
        }

        public bool MouseUp(Point position)
        {
            return false;
        }

        public bool MouseMove(Point position, bool isMouseDown)
        {
            if (isMouseDown)
            {
                double d = Helper.GetDistance(this.Editor.StartPoint, position);
                double factor = 1 + d / 300;
                this.Editor.Zoom = factor;
            }
            return true;
        }

        public bool MouseEnter()
        {
            return false;
        }

        public bool MouseLeave()
        {
            return false;
        }

        public bool MouseWheel(int delta)
        {
            return false;
        }
        #endregion
    }
}
